package com.hgw.Demo07_ObserverPattern.Exercises22_9_4;

import java.util.Observable;

/**
 * Data time:2021/12/19 17:30
 * StudentID:2019112118
 * Author:hgw
 * Description: 猫，充当具体目标类
 */
public class Cat extends Observable {
    private String name;

    public Cat(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void call() {
        System.out.println(this.name + "猫咪大叫了一声！");
        super.setChanged();
        super.notifyObservers();
    }
}
